R Tutorial: Training A Model With Resampling